#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstring>
#include<queue>
#include<algorithm>
using namespace std;
using pii = pair<int, int>;
const int N = 100010, M = N * 2;
int h[N], e[M], ne[M], w[N], target[M], idx;
int dist[N];
bool st[N];
priority_queue<pii, vector<pii>, greater<pii> > heap;
int n, m, k, t;
void add(int a, int b, int c)
{
    e[idx] = b, target[idx] = c, ne[idx] = h[a], h[a] = idx++;
}
void dijkstra()
{
    while (heap.size())
    {
        auto t = heap.top();
        heap.pop();
        int x = t.second;
        if (st[x]) continue;
        for (int i = h[x]; ~i; i = ne[i])
        {
            int y = e[i], z = target[i];
            if (dist[z] > max(dist[x], dist[y]) + max(w[x], w[y]))
            {
                dist[z] = max(dist[x], dist[y]) + max(w[x], w[y]);
                heap.push({ dist[z],z });
            }
        }
        st[x] = true;
    }
}
int main()
{
    cin >> n >> m >> k >> t;
    for (int i = 1; i <= n; i++) cin >> w[i];
    memset(h, -1, sizeof h);
    memset(dist, 0x3f, sizeof dist);
    while (m--)
    {
        int x;
        cin >> x;
        dist[x] = 0;
        heap.push({ 0,x });
    }
    while (k--)
    {
        int a, b, c;
        cin >> a >> b >> c;
        add(a, b, c), add(b, a, c);
    }
    dijkstra();
    cout << dist[t] << endl;
    return 0;
}